public class Solution9 {
    /*public boolean isPalindrome(int x) {
        String s = Integer.toString(x);
        String r = new StringBuffer(s).reverse().toString();
        if (s.equals(r)) {
            return true;
        } else {
            return false;
        }
    }*/
    public boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        int y = 0, t = x;
        while (x != 0) {
            y *= 10;
            y += x % 10;
            x /= 10;

        }
        return x == y;
    }
}
